﻿#pragma once
#include "YCodec.h"
#include <QDebug>


/// <summary>
/// 此处是视频解码器
/// </summary>
class YDecoder :public YCodec
{

public:
	/// <summary>
	/// 发送解码
	/// </summary>
	/// <param name="pkt">未解码的包</param>
	/// <returns></returns>
	bool Send(const AVPacket* pkt);
	/// <summary>
	/// 获取解码
	/// </summary>
	/// <param name="frame">解码后的AVFrame</param>
	/// <returns></returns>
	bool Receive(AVFrame* frame);
	/// <summary>
	/// 获取缓冲中的数据
	/// </summary>
	/// <returns></returns>
	std::vector<AVFrame*> End();
	/// <summary>
	/// 硬件加速解码
	/// </summary>
	/// <param name="type">硬件编码的类型，表明你要是用那种硬件编码类型</param>
	/// <returns></returns>
	bool InitHW(int type);
	YDecoder();
	~YDecoder();
	
};
